package com.zygh.policeasset.mapper;

import com.zygh.policeasset.pojo.PurchaseUse;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.type.JdbcType;

@Mapper
/* loaded from: police-asset-2.0-0.0.1-SNAPSHOT.jar:BOOT-INF/classes/com/zygh/policeasset/mapper/purchaseUseMapper.class */
public interface purchaseUseMapper {
    @Select({"select *  from purchase_use where id = #{id}"})
    @ResultMap({"purchaseUseMap"})
    PurchaseUse queryById(Integer num);

    @Select({"select *  from purchase_use where purchase_type = #{type} and status = #{status}"})
    @Results(id = "purchaseUseMap", value = {@Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), @Result(column = "use_num", property = "useNum", jdbcType = JdbcType.VARCHAR), @Result(column = "plan_time", property = "planTime", jdbcType = JdbcType.VARCHAR), @Result(column = "actual_time", property = "actualTime", jdbcType = JdbcType.VARCHAR), @Result(column = "start_time", property = "startTime", jdbcType = JdbcType.VARCHAR), @Result(column = "purchase_type", property = "purchaseType", jdbcType = JdbcType.VARCHAR)})
    List<PurchaseUse> queryAll(@Param("type") String str, @Param("status") Integer num);

    @Insert({"insert into purchase_use (use_num,plan_time,actual_time,start_time,status,purchase_type) values(#{useNum},#{planTime},#{actualTime},#{startTime},#{status},#{purchaseType})"})
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    int add(PurchaseUse purchaseUse);

    @Update({"update purchase_use set use_num = #{useNum},plan_time = #{planTime},actual_time = #{actualTime},start_time = #{startTime},purchase_type = #{purchaseType} where id = #{id}"})
    int update(PurchaseUse purchaseUse);

    @Delete({"delete from purchase_use where id = #{id}"})
    int deleteById(Integer num);

    @Update({"update purchase_use set status = #{status} where id = #{id}"})
    int updateByid(@Param("id") Integer num, @Param("status") Integer num2);
}